package org.itboys.shop.tools;

import javax.servlet.http.HttpServletRequest;

import org.itboys.member.entity.Member;
import org.itboys.seller.entity.SellerUser;

public class WXSession {
	public static Member getMember(HttpServletRequest request){
		Object object=request.getSession().getAttribute("user");
		if (null!=object) {
			return (Member)object;
		}else {
			return null;
		}
	}
	public static SellerUser getSeller(HttpServletRequest request){
		Object object=request.getSession().getAttribute("seller");
		if (null!=object) {
			return (SellerUser)object;
		}else {
			return null;
		}
	}
	public static boolean ifSellerLog(HttpServletRequest request){
		return null==request.getSession().getAttribute("seller")?false:true;
	}
	public static void putSeller(HttpServletRequest request,SellerUser user){
		request.getSession().setAttribute("seller", user);
	}
	public static void logOut(HttpServletRequest request){
		request.getSession().removeAttribute("seller");
	}
}
